package be.kuleuven.cs.mop.domain.model.impl;


import static org.junit.Assert.*;

import org.junit.*;

import be.kuleuven.cs.mop.TestEnvironment;
import be.kuleuven.cs.mop.domain.exceptions.TaskManagerException;



public class ResourceTypeImplTest {
	
	private static TestEnvironment ENV;
	
	
	
	@Before
	public void setUp() throws Exception {
		ENV = TestEnvironment.newInstance();
	}
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {}
	
	@After
	public void tearDown() throws Exception {}
	
	@AfterClass
	public static void tearDownAfterClass() throws Exception {}
	
	
	
	@Test(expected=NullPointerException.class)
	public void testConstructorInvalid0() throws TaskManagerException {
		new ResourceTypeImpl(null, null);
	}
	
	@Test(expected=TaskManagerException.class)
	public void testConstructorInvalid1() throws TaskManagerException {
		new ResourceTypeImpl(ENV.world, null);
	}
	
	@Test
	public void testConstructorValid() throws TaskManagerException {
		final ResourceTypeImpl type =
			new ResourceTypeImpl(ENV.world, "TestResourceType");
		
		assertEquals(type.getName(),	"TestResourceType");
		assertTrue(ENV.world.getResourceTypes().contains(type));
	}
	
}